<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="keywords" content="">
<meta name="description" content="一千零一夜">
<meta name="author" content="一千零一夜">
<link href="css/css.css" rel="stylesheet">
<!--标签插件-->
<link rel="stylesheet" href="js/jquery-tags-input/jquery.tagsinput.min.css">
<link href="css/style.min.css" rel="stylesheet">

<!--消息提示-->
<link href="css/animate.css" rel="stylesheet">

<!--对话框-->
<link rel="stylesheet" href="js/jconfirm/jquery-confirm.min.css">

<!--[if lt IE 9]>
    <link href="css/ie.css" rel="stylesheet" type="text/css" >
    <meta http-equiv="X-UA-Compatible" content="IE=8" >
<![endif]-->
<!--[if lte IE 6]><meta http-equiv="refresh" content="0;url=IE6/IE6.html"><![endif]-->
<link href="favicon.ico" rel="SHORTCUT ICON">
<title>一千零一夜</title>
</head>
<body cur="3" style="background-image:url(images/Events-bg.jpg)">
	<div class="lyear-layout- sidebar-scroll"></div>
	<div class="top">
		<div class="header">
			<div class="wrap clearfix pr">
				<a href="index.html" class="logo"><em></em><i></i><span></span></a>
				<ul class="nav fr">
					<li><a href="about.html">餐厅介绍</a>
						<ul class="slide-nav">
							<li><a href="about.html">成长历程</a></li>
							<li><a href="founder.html">创始人介绍</a></li>
							<li><a href="about.html">团队介绍</a></li>
						</ul></li>
					<li><a href="food.html">我们的菜单</a>
						<ul class="slide-nav">
							<li><a href="food.html">主菜</a></li>
							<li><a href="food.html">开胃菜</a></li>
							<li><a href="food.html">甜点</a></li>
						</ul></li>
					<li><a href="food.html">活动预告</a>
						<ul class="slide-nav">
							<li><a href="Discount.html">每日特惠</a></li>
						</ul></li>
					<li><a href="Book.html">预定中心</a></li>
					<li><a href="news.html">新闻资讯</a>
						<ul class="slide-nav">
							<li><a href="news.html">企业快报</a></li>
							<li><a href="news.html">最新资讯</a></li>
							<li><a href="news.html">新店开张</a></li>
						</ul></li>
					<li><a href="Wedding.html">婚宴展示</a></li>
					<li><a href="contact.html">联系我们</a>
						<ul class="slide-nav">
							<li><a href="contact.html">上海衡山路店</a></li>
							<li><a href="contact.html">北京三里屯店</a></li>
							<li><a href="contact.html">北京蓝色港湾店</a></li>
						</ul></li>
					<li><a href="order.html"> 订单中心</a></li>
				</ul>
			</div>
		</div>
	</div>

	<div class="wrap">
		<div class="w-title tc">
			<p class="title">Reservation</p>
			<div class="name">
				<span><em></em>预定中心<i></i></span>
			</div>
		</div>

		<div class="conwrap">
			<div class="con-bd">
				<img src="images/img3.png">
				<form class="bookForm" id="book_form">
					<div class="pd35 clearfix">

						<div class="control-group">
							<span class="tt">日期</span> <label> <input type="text"
								name="day" value="" class="" id="day"> <em class="myfont">&#xe678;</em>
							</label>
						</div>
						<div class="control-group">
							<span class="tt">时间</span> <label> <input type="text"
								name="time" value="" class="" id="time"> <em class="myfont">&#xe6b0;</em>
							</label>
						</div>
						<div class="control-group">
							<span class="tt" style="width:70px;">就餐人数</span> <label
								style="width:268px;"> <input type="text"
								name="personNumber" value="" class="" id="personNumb"> <em class="myfont">&#xe62b;</em>
							</label>
						</div>
						<div class="control-group">
							<span class="tt">姓名</span> <label> <input type="text"
								name="userName" value="" class="" id = "userName"> <em class="myfont">&#xe69a;</em>
							</label>
						</div>
						<div class="control-group">
							<span class="tt">手机</span> <label> <input type="text"
								name="phoneNumber" id="phoneNumber" value="" class=""> <em class="myfont">&#xe6bb;</em>
							</label>
						</div>
						<div class="control-group">
							<span class="tt">邮箱</span> <label> <input type="text"
								name="email" id="email" value="" class=""> <em class="myfont">&#xe617;</em>
							</label>
						</div>
					</div>
					<p class="tc">
						<button type="button" class="button btn-book" onclick="book()" id="Book_btn">我要预定</button>
					</p>
				</form>
			</div>
			<div class="con-bottom"></div>
		</div>

		<div class="foot">
			Copyright © 2015 www.1001.com All Rights Reserved 版权所有·一千零一夜餐厅 更多模板：<a
				href="http://www.mycodes.net/" target="_blank">源码之家</a>
		</div>

	</div>

	<a href="#" class="link-prev"></a>
	<a href="#" class="link-next"></a>

</body>
<script src="js/jquery.min.js"></script>
<script>
	function book(){
		var day = $("#day").val();//获取表单的输入值;
		var time = $("#time").val();//获取表单的输入值;
		var personNumb = $("#personNumb").val();//获取表单的输入值;
		var userName = $("#userName").val();//获取表单的输入值;
		var phoneNumber = $("#phoneNumber").val();//获取表单的输入值;
		var email = $("#email").val();//获取表单的输入值;
		
		$.ajax({
			url: './Book?method=book',
			type: 'GET',
			data: {"day":day,"time":time,"personNumb":personNumb,"userName":userName,"phoneNumber":phoneNumber,"email":email,}, 
			cache: false, //不缓存
			processData: true,
			beforeSend: function() {
					//发送url之前，启动转圈圈
					lightyear.loading('show');
				},
			contentType: 'application/json', 
			dataType: "json",
			success: function(data) {
				console.log(data.code);
				if(data.code == 1) {
					//增加成功
					setTimeout(function() {
						alert("预定成功，跳转到菜单页......");
						window.location.href="food.html";
					}, 1500);
				} else if(data.code == -1) {
					setTimeout(function() {
						alert("预定失败，请重新提交......");
						window.location.href="Book.html";
					}, 1000);
				} 
			}
		});	
	}
</script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>

<script src="js/jquery.js"></script>
<script src="js/Action.js"></script>
<!--标签插件-->
<script src="js/jquery-tags-input/jquery.tagsinput.min.js"></script>


<!--消息提示-->
<script src="js/bootstrap-notify.min.js"></script>
<script type="text/javascript" src="js/lightyear.js"></script>

<!--对话框-->
<script src="js/jconfirm/jquery-confirm.min.js"></script>
</html>